package com.qili.mapper.sys;

import com.qili.base.mapper.BaseMapper;
import com.qili.entity.sys.SysUser;
import com.qili.entity.sys.dto.SysUserDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysUserMapper extends BaseMapper<SysUser, String> {

    SysUser login(@Param("username") String username);

    int count();

    int add(SysUser user);

    int delById(String id);

    int checkUser(String username);

    /**
     * 更新密码
     *
     * @param user
     * @return
     */
    int rePass(SysUser user);

    List<SysUser> getUserByRoleId(@Param("roleId") String roleId);

    SysUser selectByEmail(String email);

    int updateById(String id, String password);

    SysUser selectById(String id);

    SysUserDTO selectUserById(String id);

    int updateUser(SysUser sysUser);

    int updateNum(SysUser sysUser);

     List<SysUser> getUserDicts(SysUserDTO sysUser);

    void updateTags(SysUser sysUser);

    int getSamePhoneUsersWithoutMe(SysUser sysUser);

    int getSameEmailUsersWithoutMe(SysUser sysUser);

    int selectJsdwglrCount();

    List<SysUserDTO> selectProjectAdmin(String projectId);

    List<SysUserDTO> selectUsefulUsers(SysUser user);

    void saveUserFromFile(SysUser user);

    int checkUserEmail(String email);

    /**
     * 智能检索统计  统计人员数据
     * @param map
     * @return
     */
    List<SysUserDTO> selectUserStats(Map map);


    // 按照擅长领域统计
    List<SysUserDTO> selectUserTjByDoBest(SysUserDTO dto);
    // 按照擅长领域统计详情
    List<SysUserDTO> selectUserTjByDoBestDetail(SysUserDTO dto);
    // 证书统计
    List<SysUserDTO> selectUserTjByCert(SysUserDTO dto);
    // 证书统计
    List<SysUserDTO> selectUserByCert(SysUserDTO dto);
    // 证书统计详情列表
    List<SysUserDTO> selectUserTjByCertDetail(SysUserDTO dto);
    //查询人员统计信息
    List<SysUserDTO> selectUserTjList(SysUserDTO dto);

    //查询部门信息
    List<SysUserDTO> selectdeptList(SysUserDTO dto);
    //企业信息统计
    List<SysUserDTO> selectComTjList(SysUserDTO dto);

    //综合服务查询考生
    List<SysUserDTO> selectExstu(Map map);

    List<String> selectUserIdListForPushMsg(String applicantId);

    SysUser phoneLogin(@Param("phone") String phone);

    int updatePassWordByPhone(String phoneNumber, String password);

    int updatePasswordUsername(String username, String password);

    SysUser selectUser(String username);

    /**
     * 导出用户角色
     * @param dto
     * @return
     */
    List<SysUserDTO> selectExportUsers(@Param("dto") SysUserDTO dto);
}
